package com.cloud.common.constants;

/**
 * 全局常量定义
 *
 * @author yzj
 */
public class GlobalConstants {

    // 令牌失效单位(分钟)
    public static final long MILLIS_MINUTE = 60 * 1000;
    // 令牌失效时间单位(60分钟)
    public static final Long MILLIS_MINUTE_TEN = MILLIS_MINUTE * 60;
    // 令牌有效期(默认480分钟)
    public static final Long EXPIRE_TIME = 480L;

    // 默认附件节点名称(用于附件地址截取替换)
    public static final String annexNodeName = "annex";
    public static final String iconNodeName = "icon";
    // UTF-8 字符集
    public static final String UTF_8 = "UTF-8";
    // http请求
    public static final String HTTP = "http://";
    // https请求
    public static final String HTTPS = "https://";
    // 监控服务请求地址
    public static final String MONITOR_SERVICE_URL = "service/monitor/inAuth/getServerInfo";
    // 监控缓存请求地址
    public static final String MONITOR_REDIS_URL = "service/monitor/inAuth/getRedisInfo";
    // 监控数据连接池请求地址
    public static final String MONITOR_DRUID_URL = "druid/login.html";

    // 登录账户主键存储标识
    public static final String userId = "userId";
    // 登录账户存储标识
    public static final String userName = "userName";
    // 登录账户部门主键
    public static final String deptId = "deptId";
    public static final String tokenKey = "tokenKey";
    // 登录账户信息储存标识
    public static final String loginUser = "loginUser";

    // 请求令牌Header标识
    public static final String appTokenHeader = "App-Token-Header";
    public static final String tokenHeader = "Authorization";
    // 系统防重提交 redis_key
    public static final String repeatSubmit = "repeat_submit:";
    // 系统登录验证码有效期(分钟)
    public static final Integer codeExpiration = 3;
    // 系统登录验证码 code_redis
    public static final String sysLoginCode = "sys_login_code:";
    // 系统登录失败次数
    public static final String sysLoginNum = "sys_login_num:";
    // 系统登录账户 token_key_redis
    public static final String sysLoginTokens = "sys_login_tokens:";
    // 登录账户/关联项目授权权限
    public static final String sysUserProject = "sys_user_project:";
    // 系统登录授权Token标识
    public static final String authTokenCode = "auth_token_code:";

    // 系统初始化前端配置参数
    public static final String sysConfigInfo = "sys_config_info";
    // 系统用户信息 sys_user_info
    public static final String sysUserInfo = "sys_user_info";
    // 系统字典信息 sys_dict_info
    public static final String sysDictInfo = "sys_dict_info";

    // Magic-Api开发者信息
    public static final String magicTokens = "magic_tokens:";
    // Magic-Api 开启缓存查询Header
    public static final String openRedisHeader = "Open-Redis-Header";
    // Magic-Api 缓存标识 magic_api_redis
    public static final String magicApiRedis = "magic_api_redis:";

    // Magic-Api 缓存有效期(分钟)
    public static final Integer openExpiration = 15;

    // 移动端缓存标识 mobile_module_redis
    public static final String mobileModule = "mobile_module:";
    // Banner轮播图列表缓存
    public static final String applyBannerMap = mobileModule + "apply_banner_map";

}
